﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Frontend.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Thông tin
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <% Partner obj = (Partner)ViewData.Model;
       List<sp_GetPartnerAddressListResult> listAddress = (List<sp_GetPartnerAddressListResult>)ViewData["PartnerAddesssList"];
       sp_GetMainPartnerAddressResult objMainAddress = (sp_GetMainPartnerAddressResult)ViewData["MainPartnerAddesss"]; %>
    <%= Html.Hidden("URLBack", (string)ViewData["LinkBack"])%>
    <table width="100%" border="1" cellspacing="0" cellpadding="0" style="border-collapse: collapse;
        border-color: #CCCCCC">
        <tr>
            <td align="center">
                <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr>
                        <td>
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td width="1%" class="br3">
                                        &nbsp;
                                    </td>
                                    <td width="22%" align="left" class="style2a">
                                        <strong><%= (string)ViewData["NavigationLink"]%></strong>                                        
                                    </td>
                                    <td width="3%" class="br4" align="left">
                                        <div class="lprefix"></div>
                                    </td>
                                    <td class="style2b">
                                         <strong><%= obj.PartnerName %></strong>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
               
        <tr>
            <td>
                <table width="100%" border="0" cellpadding="0" cellspacing="0" class="style">
                    <tr>
                        <td colspan="6" height="10">
                        </td>
                    </tr>
                    <tr>
                        <td width="2%" rowspan="2">
                            &nbsp;
                        </td>
                        <td width="19%" rowspan="2">
                            <img src="<%=Constants.PHOTO_PATH_ROOT_PARTNER + obj.Logo%>" width="139" height="139" />
                        </td>
                        <td width="2%" rowspan="2">
                            &nbsp;
                        </td>
                        <td colspan="2" valign="top" class="style">
                            <strong><%= HttpUtility.HtmlEncode(objMainAddress.DisplayAddress) %><br />
                                Ðiện thoại:</span><%= HttpUtility.HtmlEncode(objMainAddress.Phone) %><br />
                                Email:<%= HttpUtility.HtmlEncode(obj.Email) %><br />
                                Website:<%= HttpUtility.HtmlEncode(obj.Webiste) %><br />
                                Giảm giá:<%= HttpUtility.HtmlEncode(obj.DiscountInfo) %><br />
                                
                                <br />
                            </strong>
                        </td>
                        <td width="2%" rowspan="2">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td width="27%" valign="top" class="style5">
                            <a href="/dang-ky-so-huu-the.html">
                                                    <img src="/Themes/images/h_6.jpg" /></a>
                        </td>
                        <td width="48%" class="style5">
                            <% List<Promotion> listPromotion = (List<Promotion>)ViewData["PartnerPromotion"];
                                if (listPromotion.Count > 0)
                                {%>
                            <a href="#tips" class="textlink3"><strong>+ Xem chương trình khuyến mãi </strong></a>
                                <%} %>
                        </td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td colspan="4">
                            <%if (listAddress.Count > 0)
                              { %>
                            <div class="branch">
                                <div class="title">
                                    Các chi nhánh</div>
                                <% int i = 1;
                                   foreach (sp_GetPartnerAddressListResult item in listAddress)
                                   {%>
                                <div>
                                    <p>
                                        <b>Chi nhánh
                                            <%=i%></b></p>
                                    <p>
                                        <%= HttpUtility.HtmlEncode(item.Address) + " , " + item.DistrictName + " , " + item.ProvinceName%><br />
                                        Điện thoại:<%= HttpUtility.HtmlEncode(item.Phone)%></p>
                                </div>
                                <%i++;
                                   } %>
                            </div>
                            <%} %>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="6" height="10">
                        </td>
                    </tr>
                    <tr>
                        <td colspan="6">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td width="7" class="br4" height="22">
                                        &nbsp;
                                    </td>
                                    <td width="107" align="left" class="style2c">
                                        <strong>Giới thiệu chung</strong>
                                    </td>
                                  
                                    
                                    <td class="style2c">
                                        &nbsp;
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td rowspan="3">
                            &nbsp;
                        </td>
                        <td colspan="4" height="12">
                        </td>
                        <td rowspan="3">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">
                           <%=obj.Description %>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" height="12">
                        </td>
                    </tr>
                    <tr>
                        <td colspan="6">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td width="7" class="br4" height="22">
                                        &nbsp;
                                    </td>
                                    <td align="left" class="style2c">
                                        <strong>Hình ảnh</strong>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td rowspan="3">
                            &nbsp;
                        </td>
                        <td colspan="4" height="12">
                        </td>
                        <td rowspan="3">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" align="center"  style="width:400px;text-align:left;padding-left:150px;">
                           <ul class="pcontent" id="myGallery">
                                <%List<Gallery> listGallery = (List<Gallery>)ViewData["PartnerGallery"];
                                  if (listGallery.Count > 0)
                                  { %>
                                <% foreach (Gallery gallery in listGallery)
                                   {%>
                                    <li >
                                    <img src="<%=Constants.PHOTO_PATH_ROOT_PARTNER + gallery.Image%>" width="400" title="" alt=""/></li>
                                <%} %>
                                <%} %>
                            </ul>
                        </td>
                    </tr>
                     <tr>
                        <td colspan="4" height="12">
                        </td>
                    </tr>
                    <tr>
                        <td colspan="6" id="tips">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td width="7" class="br4" height="22">
                                        &nbsp;
                                    </td>
                                    <td align="left" class="style2c">
                                        <strong >Tin khuyến mãi</strong>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td rowspan="3">
                            &nbsp;
                        </td>
                        <td colspan="4" height="12">
                        </td>
                        <td rowspan="3">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4">
                       
                                <table width="100%" border="0" cellspacing="2" cellpadding="2">
                                 <%int promotionIndex = 1;
                                   foreach (Promotion promotion in listPromotion)
                                   {%>
                                    <tr>
                                        <td class="ol-promotion">
                                            <span><%=promotionIndex%></span>
                                        </td>
                                        
                                        <td width="96%">
                                            <a  href="<%=FRouter._("khuyenmai", promotion.ID.ToString(), promotion.Title) %>" class="textlink3">
                                                <%= HttpUtility.HtmlEncode(promotion.Title) %>
                                            </a>
                                        </td>
                                    </tr>
                                
                                <% promotionIndex++;
                                   }
                                %>
                                </table>
                            
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" height="12">
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
    <script src="../../Scripts/jquery-timers.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery-easing.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery-galleryview3.0.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery-ui-1.7.2.custom.min.js" type="text/javascript"></script>
    <link href="../../Scripts/jquery.fancybox-1.3.4.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/jquery.fancybox-1.3.4.js" type="text/javascript"></script>
    <script type="text/javascript">
        function filter() {
            JS_LIB.setFilter($("#txtKeyWord").val(), $("#ProvinceList").val(), $("#DistrictList").val(), $("#URLBack").val());
        }
        $(document).ready(function () {
            $('#myGallery').galleryView({
                panel_width: 400,
                panel_height: 200,
                frame_width: 60,
                frame_height: 40,
                show_fancybox: 'fancy'                                
            });
            $("a.fancy").fancybox();
            $('#myGallery :first').css("display", "block");
            $("#ProvinceList").change(function () {
                var provinceID = $("#ProvinceList").val();
                $("#DistrictList").html("");
                $("#DistrictList").append($("<option value=''><%= Constants.CATEGORY_FIRST_DISTRICT %></option>"));
                if (provinceID != 0) {
                    $.getJSON('/Library/GenericHandle/DropdownListHandler.ashx?ID=' + provinceID + '&Page=District', function (item) {
                        $.each(item, function () {
                            $("#DistrictList").append($("<option value='" + this['ID'] + "'>" + this['Name'] + "</option>"));
                        });
                    });
                }
            });            
        });
    </script>
</asp:Content>
